package com.laxcen.smoke.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 接收前端传过来的图片返回服务器路径配置类
 */
@Configuration
class MultipartConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

        /**
         *  /source/xxx   指文件的访问方式  如：localhost:8080/source/abc.wav
         *  file:d/voice/  指静态文件存放在服务器上的位置
         */
        registry.addResourceHandler("/adverimg/**").addResourceLocations("file:shiro-core/src/main/resources/webapp/adverimg/");
    }
}
